<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHomeworkInfoTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('homework_info', function (Blueprint $table) {
//            $table->comment('作业信息数据表');
            $table->bigIncrements('id')->comment('主键ID');
            $table->bigInteger('activity_id')->comment('教研活动管理ID');
            $table->integer('homework_id')->default(0)->comment('作业关联id');
            $table->integer('user_id')->default(0)->comment('老师关联id');
            $table->longText('resource')->nullable()->comment('上传附件');
            $table->text('describe')->nullable()->comment('描述');
            $table->tinyInteger('score')->default(0)->comment('分数');
            $table->timestamp('created_at')->useCurrentOnUpdate()->nullable();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('homework_info');
    }
};
